 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>代理商归属详情</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link href="<s:url value="/css/a.css"/>" type="text/css"
	rel="stylesheet" />
<link href="<s:url value="/css/index.css"/>" type="text/css"

	rel="stylesheet" />
	 <link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
<script type="text/javascript"
	src="<s:url value="/js/jquery-1.9.1.min.js" />"></script>
<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>

<style type="text/css">
.blue{
	color: blue
}
</style>
<script type="text/javascript"src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript">
$(document).ready(function(){
	
		$('#sub').click(function(){
			   if(!checkDate()){
		           return false;
		         }  
			
			$("#queryForm").attr("action","<%=basePath%>/agentAff/queryAgentAffiliation.ct");
			$("#queryForm").submit();
			$(this).attr("disabled","true");
			
		});
	});	
	
function   str2date(str){
	var d=null;   
	var reg=/^(\d{4})(\d{2})(\d{2})$/  ;
		if(arr=str.match(reg))d=new   Date(Number(arr[1]),Number(arr[2])-1,Number(arr[3])) ; 
	return   d;   
}  
 

function  checkDate(){
	var endTime = $("#maxDate").val();
	var beginTime = $("#minDate").val();
	
	if(!endTime || !beginTime){
		alert("开通时间范围必须选择!");
		return false;
	} 
	var date1=str2date(beginTime);
	var date2=str2date(endTime);
		
	if(date1.getMonth()!=date2.getMonth()){
	    alert("选择的开通时间不在同一个月内！");
		return false;
	}
	
	if(date2.getDate()<date1.getDate()){
		alert("选择的结束时间不能小于起始时间！");
		return false;
	}
	return true;
}
</script>
</head>

<body>
		<s:form id="queryForm" action="/agentAff/queryAgentAffiliation.ct" method="post"
			theme="simple">
		 <table class="tb">
				<tr class="tb-line">
            		<td class="tb-td" colspan="6"><div class="tb-h2">POS收单运营管理平台</div></td>
        		</tr>
			    <tr class="tb-line">
					<td class="tb-td" colspan="6">
						<div class="tb-h3">代理商归属详情查询</div>
					</td>
				 </tr>



		 <tr class="tb-line">
           <td align="right" class="tb-td">
                <div class="tb-h4">代理商账号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal"><input type="text" id="account" name="searchCondition.account" value="<c:if test='${searchCondition.account != null }'>${searchCondition.account }</c:if>" /></label>
            </td>
            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">开通日期：</div>
            </td>
            <td class="tb-td">
	                <label class="tb-input-mini">
	                	<s:textfield id="minDate" name="searchCondition.minDate" onFocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});"
							theme="simple" cssClass="queryWidth" /> 
					</label>至：
					<label class="tb-input-mini">
						<s:textfield id="maxDate" name="searchCondition.maxDate" onFocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});"
							theme="simple" cssClass="queryWidth" />
					</label>
					<code class="asterisk">*</code>
				</td>	
            <%--  <td class="tb-td">
		                <label class="tb-input-normal"><s:textfield  
							name="searchCondition.minDate"
							onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,wdate:true,errDealMode:0});"
							theme="simple" cssClass="queryWidth" /> </label>到
		                <label class="tb-input-normal"><s:textfield
							name="searchCondition.maxDate"
							onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,wdate:true,errDealMode:0});"
							theme="simple" cssClass="queryWidth" /></label>
		    </td>  --%>
        </tr>
				
				
				
				
				<tr>
						<td colspan="7" align="center"><span style="color: red"><s:actionerror /></span>
							<span style="color: red;"><s:actionmessage /></span > <span style="color: red;"><s:fielderror
									cssClass="fieldError" /></span>
							<span id="otherError"></span>
						</td>
					</tr>
				 <tr class="tb-line">
           		 <td class="tb-td line-submit" align="right" colspan="7">
                <label class="tb-input-submit"><input type="button" value="查询" id="sub"/></label>
				</td>
				</tr>
				
				<s:if
					test="#request.searchRsList != null && #request.searchRsList.size>0">
					<tr class="tb-line">
						<td class="tb-td paging" colspan="7"><page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/agentAff/queryAgentAffiliation.ct?currentPage=" />

						</td>
					</tr>
				</s:if>
			</table>
			
				
	<div class="big-tb">
    <table class="tb" style="width: 100%;">
				<thead>
            	<tr class="tb-line">
                <th class="tb-th" colspan="7"><div class="tb-h3">所属代理商信息列表</div></th>
            	<tr class="tb-line bg-gray">
                <th class="tb-th">角色类型</th>
                <th class="tb-th">代理商账号</th>
                <th class="tb-th">手机号</th>
                <th class="tb-th">一级代理商姓名</th>
                <th class="tb-th">代理商姓名</th>
                <th class="tb-th">证件号码</th>
                <th class="tb-th">所属大区</th>
                
            </tr>
				</thead>
				<tbody>
					 <s:iterator value="#request.searchRsList" status="stat" id="agent">
						<tr  class="tb-line"  >
						<td class="tb-td">
						代理商
					</td>
					<td class="tb-td">
						<s:property value="#agent.accountNo"/>
					</td>
					<td class="tb-td">
						<s:property value="#agent.mobile"/>
					</td>
					<td class="tb-td">
						<s:property value="#agent.oneagentName"/>
					</td>
					<td class="tb-td">
						<s:property value="#agent.realName"/>
					</td>
					
					<td class="tb-td">
						<s:property value="#agent.cardNo"/>
					</td>
					<td class="tb-td">
						<s:property value="#agent.companyName"/>
					</td>
				</tr>
						</s:iterator> 
				</tbody>
			</table>
			</div>
		</s:form>
	<s:if test="#request.info_request !=null">
	<script language="javascript">
	    alert("${request.info_request}");
	    </script>
	</s:if>	
</body>
</html>
